@extends('layout.adminindex')
<script type="text/javascript" charset="utf-8" src="/edit/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/edit/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/edit/lang/zh-cn/zh-cn.js"></script>

@section('con')
<div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span>修改文章</span>
    </div>
    <div class="mws-panel-body no-padding">
        <form class="mws-form" method='post' action="/admin/article/update" enctype='multipart/form-data'>
                {{csrf_field()}}
               <div class="mws-form-inline">
                <div class="mws-form-row">
                    <label class="mws-form-label" >文章类别</label>
                    <div class="mws-form-item">
                    <select name="cate_id" class='small' id="">
                      @foreach($list as $v)
                        <option value="{{$v['id']}}"
                            @if($v['id']==$vo['cate_id'])
                                selected
                            @endif
                        >{{$v['name']}}</option> 
                        @endforeach    
                    </select>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">文章标题</label>
                <div class="mws-form-item">
                        <input class="small" type="text" name='title' value='{{$vo['title']}}'>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">文章描述</label>
                    <div class="mws-form-item">
                        <input class="small" type="text" name='descr' value='{{$vo['descr']}}' >
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">文章主图</label>
                    <div class="mws-form-item">
                       <img src="{{$vo['pic']}}" widt='200px' alt="">
                    </div>
                </div>

                <div class="mws-form-row">
                    <label class="mws-form-label">文章图片</label>
                    <div class="mws-form-item">
                        <input class="small" type="file" name='pic'>
                    </div>
                </div>

                <div class="mws-form-row">
                    <label class="mws-form-label">文章内容</label>
                    <div class="mws-form-item">
                        <script id="editor" type="text/plain" style="width:700px;height:300px;">{!!$vo['content']!!}</script>
                    </div>
                </div>
            </div>
            <input type="hidden" name='id' value='{{$vo['id']}}'>
            <div class="mws-button-row">
                <input value="修改" class="btn btn-danger" type="submit">
                <input value="重置" class="btn " type="reset">
            </div>
        </form>
    </div>      
</div>
<script type="text/javascript">
        //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');
</script>
@endsection
